#pragma once
#include "ICamera.h"
#include "Quaternion.h"

namespace Utility{
	class QuaternionCamera : public ICamera{
	public:
		QuaternionCamera();

		void update(float dt);

		void roll(float radians);
		void pitch(float radians);
		void yaw(float radians);
		
		void moveForward(float units);
		void moveUp(float units);
		void strafe(float units);
		
		Math::Matrix<4,4>& getViewProjection();
		Math::Matrix<4,4>& getViewMatrix();
	private:
		void updateViewMatrix();
	private:
		Math::Vector<float> m_front,
							m_up,
							m_right,
							m_velocity;

		Math::Quaternion<float> m_pitchQuat,
								m_rollQuat,
								m_yawQuat;

		float	m_pitch,
				m_roll,
				m_yaw;

		float	m_pitchCap,
				m_yawCap,
				m_rollCap;

		float	m_glideFactor,
				m_maxVelocity,
				m_updateTolerance;

		bool	m_pitchUpdated,
				m_rollUpdated,
				m_yawUpdated;
	};
}

typedef boost::shared_ptr<Utility::QuaternionCamera> QuaternionCameraPtr;